<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of ShowGoldRate
 *
 */
 Yii::import('zii.widgets.CPortlet'); 
class GoldRateWidget extends CPortlet {

    public $link='Cập nhật giá mới';
    public $router='site/goldRate';
    //put your code here
    
    public function init(){
        $this->render('overlay');
        parent::init();
    }
    public function run() {
        
        parent::run();
        $this->render('button');
        //$this->renderContent();
        
    }
    public function getGoldRate(){
          return GoldRate::model()->findLatestPrice();
      }
    
    /**
     * Renders the CAPTCHA image.
     */
    protected function renderContent() {
       $this->render('application.views.site.gold_rate',array('models'=>$this->getGoldRate()));
    }

}

?>
